package com.GGG.cloud.house.index.web;

import com.GGG.cloud.house.index.domain.entity.City;
import com.GGG.cloud.house.index.domain.entity.PropertiesType;
import com.GGG.cloud.house.index.domain.vo.AgentVo;
import com.GGG.cloud.house.index.domain.vo.CustomerMessageVo;
import com.GGG.cloud.house.index.domain.vo.HouseAndAgentVo;
import com.GGG.cloud.house.index.domain.vo.HouseVo;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.ribbon.proxy.annotation.Hystrix;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO
 *
 * @author GGG
 * @version 1.0
 * @date
 */
@Controller
public class IndexController {

    @RequestMapping("index.html")
    @HystrixCommand
    public String index(ModelMap modelMap){
        modelMap.put("title","房产首页");
        modelMap.put("desc","房产首页描述");
        List<PropertiesType> types = new ArrayList<>();
        types.add(new PropertiesType(1,"公寓"));
        types.add(new PropertiesType(2,"咖啡馆"));
        types.add(new PropertiesType(3,"住宅"));
        types.add(new PropertiesType(4,"餐馆"));
        types.add(new PropertiesType(5,"商店"));
        types.add(new PropertiesType(6,"别墅"));
        modelMap.put("types",types);

        List<City> cities = new ArrayList<>();
        cities.add(new City("成都"));
        cities.add(new City("北京"));
        cities.add(new City("上海"));
        cities.add(new City("沈阳"));
        cities.add(new City("深圳"));
        cities.add(new City("广州"));
        modelMap.put("cities",cities);

        List<HouseVo> houseVos = new ArrayList<>();
        houseVos.add(new HouseVo("550 平米",2,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",4,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",7,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        modelMap.put("houseVos",houseVos);

        List<AgentVo> agentVos = new ArrayList<>();
        agentVos.add(new AgentVo("唐纳德.菲尔","(756) 447 5779","info@example.com","5房"));
        agentVos.add(new AgentVo("XX.菲尔","(756) 447 5779","info@example.com","4房"));
        agentVos.add(new AgentVo("唐纳德.菲尔","(756) 447 5779","info@example.com","5房"));
        agentVos.add(new AgentVo("GG.菲尔","(756) 447 5779","info@example.com","1房"));
        agentVos.add(new AgentVo("唐纳德.G","(756) 447 5779","info@example.com","5房"));
        modelMap.put("agentVos",agentVos);

        List<HouseAndAgentVo> houseAndAgentVos = new ArrayList<>();
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德.菲尔","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德.GG","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("陈宇","2018年12月30日","豪华公寓楼"));
        modelMap.put("houseAndAgentVos",houseAndAgentVos);
        return "index";
    }

    @RequestMapping("index-2.html")
    public String index2(ModelMap modelMap){
        modelMap.put("title","房产广告主页");
        modelMap.put("desc","房产广告主页描述");
        List<PropertiesType> types = new ArrayList<>();
        types.add(new PropertiesType(1,"公寓"));
        types.add(new PropertiesType(2,"咖啡馆"));
        types.add(new PropertiesType(3,"住宅"));
        types.add(new PropertiesType(4,"餐馆"));
        types.add(new PropertiesType(5,"商店"));
        types.add(new PropertiesType(6,"别墅"));
        modelMap.put("types",types);

        List<City> cities = new ArrayList<>();
        cities.add(new City("成都"));
        cities.add(new City("北京"));
        cities.add(new City("上海"));
        cities.add(new City("沈阳"));
        cities.add(new City("深圳"));
        cities.add(new City("广州"));
        modelMap.put("cities",cities);

        List<HouseVo> houseVos = new ArrayList<>();
        houseVos.add(new HouseVo("550 平米",2,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",4,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",7,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        modelMap.put("houseVos",houseVos);

        List<AgentVo> agentVos = new ArrayList<>();
        agentVos.add(new AgentVo("唐纳德.菲尔","(756) 447 5779","info@example.com","5房"));
        agentVos.add(new AgentVo("XX.菲尔","(756) 447 5779","info@example.com","4房"));
        agentVos.add(new AgentVo("唐纳德.菲尔","(756) 447 5779","info@example.com","5房"));
        agentVos.add(new AgentVo("GG.菲尔","(756) 447 5779","info@example.com","1房"));
        agentVos.add(new AgentVo("唐纳德.G","(756) 447 5779","info@example.com","5房"));
        modelMap.put("agentVos",agentVos);

        List<HouseAndAgentVo> houseAndAgentVos = new ArrayList<>();
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德.菲尔","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德.GG","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("陈宇","2018年12月30日","豪华公寓楼"));
        modelMap.put("houseAndAgentVos",houseAndAgentVos);
        return "index-2";
    }

    @RequestMapping("index-3.html")
    public String index3(ModelMap modelMap){
        modelMap.put("title","房产地图主页");
        modelMap.put("desc","房产地图主页描述");
        List<PropertiesType> types = new ArrayList<>();
        types.add(new PropertiesType(1,"公寓"));
        types.add(new PropertiesType(2,"咖啡馆"));
        types.add(new PropertiesType(3,"住宅"));
        types.add(new PropertiesType(4,"餐馆"));
        types.add(new PropertiesType(5,"商店"));
        types.add(new PropertiesType(6,"别墅"));
        modelMap.put("types",types);

        List<City> cities = new ArrayList<>();
        cities.add(new City("成都"));
        cities.add(new City("北京"));
        cities.add(new City("上海"));
        cities.add(new City("沈阳"));
        cities.add(new City("深圳"));
        cities.add(new City("广州"));
        modelMap.put("cities",cities);

        List<HouseVo> houseVos = new ArrayList<>();
        houseVos.add(new HouseVo("550 平米",2,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",4,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",6,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        houseVos.add(new HouseVo("550 平米",7,4,3,"江南宅院","锦江区东大街下东大街568号","￥550/月","出租"));
        modelMap.put("houseVos",houseVos);

        List<AgentVo> agentVos = new ArrayList<>();
        agentVos.add(new AgentVo("唐纳德.菲尔","(756) 447 5779","info@example.com","5房"));
        agentVos.add(new AgentVo("XX.菲尔","(756) 447 5779","info@example.com","4房"));
        agentVos.add(new AgentVo("唐纳德.菲尔","(756) 447 5779","info@example.com","5房"));
        agentVos.add(new AgentVo("GG.菲尔","(756) 447 5779","info@example.com","1房"));
        agentVos.add(new AgentVo("唐纳德.G","(756) 447 5779","info@example.com","5房"));
        modelMap.put("agentVos",agentVos);

        List<HouseAndAgentVo> houseAndAgentVos = new ArrayList<>();
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德.菲尔","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德.GG","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("唐纳德","2018年12月30日","豪华公寓楼"));
        houseAndAgentVos.add(new HouseAndAgentVo("陈宇","2018年12月30日","豪华公寓楼"));
        modelMap.put("houseAndAgentVos",houseAndAgentVos);

        List<CustomerMessageVo> customerMessageVos = new ArrayList<>();
        customerMessageVos.add(new CustomerMessageVo("assets/static/images/review/review-1.jpg","房产交易平台the best theme for elit, sed do eiusmod tempor dolor sit amet, conse ctetur adipiscing elit.","John Carlson","CEO"));
        customerMessageVos.add(new CustomerMessageVo("assets/static/images/review/review-2.jpg","房产交易平台the best theme for elit, sed do eiusmod tempor dolor sit amet, conse ctetur adipiscing elit.","John Carlson","CEO"));
        customerMessageVos.add(new CustomerMessageVo("assets/static/images/review/review-3.jpg","房产交易平台the best theme for elit, sed do eiusmod tempor dolor sit amet, conse ctetur adipiscing elit.","John Carlson","CEO"));
        customerMessageVos.add(new CustomerMessageVo("assets/static/images/review/review-4.jpg","房产交易平台the best theme for elit, sed do eiusmod tempor dolor sit amet, conse ctetur adipiscing elit.","John Carlson","CEO"));
        modelMap.put("customerMessageVos",customerMessageVos);
        return "index-3";
    }
}
